﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplicationTest
{
    public partial class test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //String APKTOOL = @"D:\sci\Visual Studio 2008\Projects\APK_Tool\APK_Tool\bin\Debug\\APK_Tool.exe";
            //System.Diagnostics.Process.Start(APKTOOL);
        }

        //[DllImport("shell32.dll ")]
        //public static extern int ShellExecute(IntPtr hwnd, StringBuilder lpszOp, StringBuilder lpszFile, StringBuilder lpszParams, StringBuilder lpszDir, int FsShowCmd);

        //public static void Start2(String fileName, String Dir, String arguments)
        //{
        //    //ShellExecute(IntPtr.Zero, new StringBuilder("Open"), new StringBuilder("要执行程序的名称"), new StringBuilder("参数"), new StringBuilder("要执行程序的目录"), 1);
        //    ShellExecute(IntPtr.Zero, new StringBuilder("Open"), new StringBuilder(fileName), new StringBuilder(arguments), new StringBuilder(Dir), 1);
        //}

        protected void Button1_Click(object sender, EventArgs e)
        {
            //String APKTOOL = @"D:\sci\Visual Studio 2008\Projects\APK_Tool\APK_Tool\bin\Debug\APK_Tool.exe";
            //System.Diagnostics.Process.Start(APKTOOL);
            //Proces.I.Start(APKTOOL, null);

            //Proces.I.Start2("APK_Tool.exe", @"D:\sci\Visual Studio 2008\Projects\APK_Tool\APK_Tool\bin\Debug", "");

            string dirPath = HttpContext.Current.Server.MapPath("tools/");
            String APKTOOL = dirPath + "APK_Tool.exe";

            Label1.Text = APKTOOL;
            System.Diagnostics.Process.Start(APKTOOL);
        }
    }
}